package com.wechat;


import com.wechat.util.WechatUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.support.SpringBootServletInitializer;

@ServletComponentScan
@SpringBootApplication
public class App extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(App.class);
    }

    public static void main(String[] args) {
        String json = " {\n" +
                "     \"button\":[\n" +
                "     {    \n" +
                "          \"type\":\"click\",\n" +
                "          \"name\":\"授权登录\",\n" +
                "          \"key\":\"V1001_LOGIN\"\n" +
                "      },\n" +
                "\t   {    \n" +
                "          \"type\":\"click\",\n" +
                "          \"name\":\"联系方式\",\n" +
                "          \"key\":\"V1001_MOBILE\"\n" +
                "      },\n" +
                "      {\n" +
                "           \"name\":\"更多\",\n" +
                "           \"sub_button\":[\n" +
                "           {    \n" +
                "               \"type\":\"view\",\n" +
                "               \"name\":\"查看文章\",\n" +
                "               \"url\":\"http://daxuexiu.cn\"\n" +
                "            },\n" +
                "            {\n" +
                "               \"type\":\"click\",\n" +
                "               \"name\":\"赞一下我们\",\n" +
                "               \"key\":\"V1001_GOOD\"\n" +
                "            }]\n" +
                "       }]\n" +
                " }";
        WechatUtil.createMenu(json);
//          WechatUtil.deleteMenu();
        SpringApplication.run(App.class, args);
    }
}
